package com.ysm.smfu.food;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import com.ysm.smfu.R;
import com.ysm.smfu.activity.BaseActivity;
import com.ysm.smfu.holder.OrderPsdHolder;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 申请退款
 */
public class FoodTuiKuanActivity extends BaseActivity {

    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.title_body)
    TextView titleBody;
    @BindView(R.id.title1)
    TextView title1;
    @BindView(R.id.orderPsds)
    RecyclerView recyclerView_orderPsds;
    @BindView(R.id.title2)
    TextView title2;
    @BindView(R.id.jiner)
    TextView jiner;
    @BindView(R.id.tuiKuanNum)
    TextView tuiKuanNum;
    @BindView(R.id.title3)
    TextView title3;
    @BindView(R.id.noYuYue)
    CheckBox noYuYue;
    @BindView(R.id.noJiDai)
    CheckBox noJiDai;
    @BindView(R.id.noSatisfy)
    CheckBox noSatisfy;
    @BindView(R.id.confirm)
    Button confirm;


    @Override
    protected void initViews() {
        super.initViews();
        setContentView(R.layout.activity_food_tui_kuan);
        ButterKnife.bind(this);
        title.setText("申请退款");
    }

    @Override
    protected void initListener() {
        super.initListener();
        LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        recyclerView_orderPsds.setLayoutManager(layoutManager);
        recyclerView_orderPsds.setAdapter(new OrderPsdAdapter());
    }

    @OnClick({R.id.back})
    public void onclick(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.confirm:
                upLoadInfo();
                break;
        }
    }

    /**
     * 上传用户选择信息
     */
    private void upLoadInfo() {

    }

    class OrderPsdAdapter extends RecyclerView.Adapter<OrderPsdHolder> {
        @Override
        public OrderPsdHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(FoodTuiKuanActivity.this).inflate(R.layout.holder_orderpsd, null);

            return new OrderPsdHolder(view);
        }

        @Override
        public void onBindViewHolder(OrderPsdHolder holder, int position) {
//            holder.setData(position,);
        }

        @Override
        public int getItemCount() {
            return 3;
        }
    }
}
